package com.example.tellwin.utils;

import org.json.JSONObject;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * @author : LinZePeng
 * @date : 2020/11/25
 * @Describe ：
 **/
public class HttpUtils {

    public static RequestBody getRequestBody(String... str) {
        JSONObject requestData = new JSONObject();
        try {
            for (int i = 0; i < str.length; i = i + 2) {
                requestData.put(str[i], str[i + 1]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogUtil.e("requestData" , requestData.toString());
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), requestData.toString());
        return requestBody;
    }
}
